package com.framework.entity.base;

import lombok.Data;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.Serializable;
import java.util.UUID;

/**
 * @Description: 基础的id实体类
 * @Author: JamesYao
 * @DateTime: 2023/12/14 0:46
 */

@MappedSuperclass
@Data
public class BapBaseEntity implements Serializable {
    @Id()
    @Type(type = "uuid-char")
    @GenericGenerator(name = "uuid2", strategy = "org.hibernate.id.UUIDGenerator")
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Comment("主键id")
    @Column(length = 128)
    private UUID  id;
}
